package com.clhbolg.event;

import com.clhbolg.domain.Article;
import com.clhbolg.enums.OperationEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @Author cailinhu
 * @Description 事件推送器
 * @Date 2023/3/14 14:48
 * @Version 1.0
 */
@Component
public class ArticleEventPush {
    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    public void articlePush(Article article, OperationEnum operationEnum){
        applicationEventPublisher.publishEvent(new ArticleEvent(article,operationEnum));
    }


}
